global.window = this  // 这行代码还是顶呱呱，直接解决了这个库里面引用不到 window 的问题
const JSEncrypt = require('jsencrypt')
const priKey = '-----BEGIN PRIVATE KEY-----\n' +
    'MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDHQ8XSDmXkdr4y\n' +
    '4LuPlhfhGE8uwPC5JRLK/zAgPpj3T+SJp6Mukl6rsVyGeJb45hBUtGitVv8boWh9\n' +
    'bSrw5E3fNO6aQOhPX8FpzMV3M39Bl3RhZdrqZyTHgIv0R4Y89wVay599iCV/VIgl\n' +
    'o5HiYv0msU1OZKJFmSF13kCsdv0ngADEEGUfV6bXk5mBFekmDGhQ10LesCGc8Eam\n' +
    'UPjSQSBEGoDtn9xcxZgk7KSv07CIQUjjV8mwwe13r25gxK3XbWsCTzxT+lHhvF9z\n' +
    '4GqXHqNkZAS404xOvsqadElooQNxA/Skj/fqPiCYVr5aOGLIuzrrGDoBfVU/E0CJ\n' +
    'BW7Ry0IpAgMBAAECggEAAnQkMHT67jhEGU5JIPiBLMVm3DWGAVGijJtd1VfP/GOg\n' +
    'dc15pe4pekXB1OoROdljZBegnlnO5GE1by3z9GlrSA9XzNB1y9xq/kmGOPSKYZ1i\n' +
    '0nw1mONSQZ6kmopy7bdA+qA9Q4d0pr+8uXHtLvN3GI3gXNHCacb78X6eH0GL1nuo\n' +
    'cNo+RpRBpOPeoK+wYSVbzlRMkpF/brgF11Wj8G4CEKtGU42Q1Ri9bX2EcOT5h55F\n' +
    '8WvztJ0TH3q7kyNvx5oMXy3t2INY0rxcpxfhOrM3FfeVgtuXje3H0VBn8kS/Vo3r\n' +
    'UwEv5dFFqN+QJ5pkm+d8oVE++ypzU3SLdIQ7jUcegQKBgQD3c9BtVuaLkwgXGehM\n' +
    'BdCUU7ygooeECLM4cF6+itbpGMRr2Uf3ApjKoVFqMyRUeI6rKUTHsLxgxCe3dbh5\n' +
    '74ogIXWJyrBFCF3wugwt4hoBphubX0d82i27UKRADYkomzPOUa+5TpPaewp9iBW/\n' +
    'Ltx6Y4iEdqxPpO392R2qLu0uGQKBgQDOJdePePeJ7rs++aKmD4D/jCOMEkNDGfZ0\n' +
    'PlvGyX5cYw9XwFApBzKp6XPqGUMNM5tH2xlP25xQkfM8gq1g8IHpvEYuHQ389i10\n' +
    '7Qzq/xuKNfssnqtVtsKgjAqj8oGdg+M4vzRXCGtP5vtaJWQ8ueEezqis2Ld86Ip7\n' +
    'xJ+8iy4WkQKBgQDf1ri8n3ZO3YLc+seCNWRXOGQR3tO9IO2V6TgbHpaHJqtPb65E\n' +
    'h+nUqhZufbKoYqGTvPIFvR66XdYbg3aLfp6wr/OV4G6RE59+iZ1IyBWEVlD0vDx7\n' +
    'eRUTM0BQ3K2suLAlOwk9FBJ0+QYlRbt+RJKWd4DfakY2iVfrX8IQ1wAfyQKBgEbF\n' +
    'YQqFSd4VkjzdcMQ3wF562t1Ei8jmieCAY/uLwxCuhV7ny9059l+0oLG2eHl4xQ9X\n' +
    'HYp352MVp/6XEjScfM0kcKd2HA5C6Xohw3SNngPF4nQACOwFMS3yxdhg8bSEyaX6\n' +
    'plpWrpigwJvDCHV8jteHtQqZ3+xG3Pv+laQh1/GxAoGBAI5kLp5Ub9WshAFtEPiN\n' +
    'AGaOjxBPoJ2UdyMNDznUHA0+/PdDyJ4WulBszgBSkz4EnwN/1yx9oef+HOy7k4dG\n' +
    'imTp5eIIy8vKFGeyQnFRVdD1qNBZjTzqqJHL1fPRK8fXQnFT7n6xRCoMQ4z/BuUM\n' +
    'vi6AZNNfEPooFvZJ1ZH4ZZkL\n' +
    '-----END PRIVATE KEY-----\n'
const RSA = {
    toDecrypt(str) {
        const rsa = new JSEncrypt()
        rsa.setPrivateKey(priKey)
        return rsa.decrypt(str)
    }
}
module.exports = RSA
